* or %NULL to use the default label, 'page N'.
*
* Appends a page to @notebook.
+ *
+ * Return value: the index (starting from 0) of the appended
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_append_page (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label)
{
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
- gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, -1);
+ return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, -1);
}
/**
*
* Appends a page to @notebook, specifying the widget to use as the
* label in the popup menu.
+ *
+ * Return value: the index (starting from 0) of the appended
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_append_page_menu (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label,
GtkWidget *menu_label)
{
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
- g_return_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
+ g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
- gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, -1);
+ return gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, -1);
}
/**
* or %NULL to use the default label, 'page N'.
*
* Prepends a page to @notebook.
+ *
+ * Return value: the index (starting from 0) of the prepended
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_prepend_page (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label)
{
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
- gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, 0);
+ return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, 0);
}
/**
*
* Prepends a page to @notebook, specifying the widget to use as the
* label in the popup menu.
+ *
+ * Return value: the index (starting from 0) of the prepended
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label,
GtkWidget *menu_label)
{
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
- g_return_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
+ g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
- gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, 0);
+ return gtk_notebook_insert_page_menu (notebook, child, tab_label, menu_label, 0);
}
/**
* @position: the index (starting at 0) at which to insert the page,
* or -1 to append the page after all other pages.
*
- * Insert a page into @notebook at the given position
+ * Insert a page into @notebook at the given position.
+ *
+ * Return value: the index (starting from 0) of the inserted
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_insert_page (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label,
gint position)
{
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
- gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, position);
+ return gtk_notebook_insert_page_menu (notebook, child, tab_label, NULL, position);
}
*
* Insert a page into @notebook at the given position, specifying
* the widget to use as the label in the popup menu.
+ *
+ * Return value: the index (starting from 0) of the inserted
+ * page in the notebook, or -1 if function fails
**/
-void
+gint
gtk_notebook_insert_page_menu (GtkNotebook *notebook,
GtkWidget *child,
GtkWidget *tab_label,
GtkNotebookPage *page;
gint nchildren;
- g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
- g_return_if_fail (GTK_IS_WIDGET (child));
- g_return_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label));
- g_return_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label));
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), -1);
+ g_return_val_if_fail (tab_label == NULL || GTK_IS_WIDGET (tab_label), -1);
+ g_return_val_if_fail (menu_label == NULL || GTK_IS_WIDGET (menu_label), -1);
gtk_widget_freeze_child_notify (child);
gtk_widget_child_notify (child, "menu_label");
gtk_widget_child_notify (child, "position");
gtk_widget_thaw_child_notify (child);
+
+ return position;
}
/**